<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="js/jquery-latest.js"></script>
<script type="text/javascript" src="js/trade.js"></script>
<script type="text/javascript">

	function collapseAll(num, vv) {
		var i = 1;
		var collapseAllOrder = $("#collapseAllOrder");
		
		for(i; i <= num; i++) {
			expand(i, vv);
		}
		
		if(vv) {
			collapseAllOrder.attr("onclick", "collapseAll(" + num + ", false)");
			collapseAllOrder.attr("value", "展开全部");
		} else {
			collapseAllOrder.attr("onclick", "collapseAll(" + num + ", true)");
			collapseAllOrder.attr("value", "折叠全部");
		}
	}

	function expand(id, vv) {
		var item_name = 'item' + id;
		var button_id = 'button_' + id;
		var tr = $("tr[name='" + item_name + "']");
		var btn = $("#" + button_id);
		
		if(vv) {
			tr.attr("style", "display:none");
			btn.attr("value", "展开");
			btn.attr("onclick", "expand(" + id + ", false)");
		} else {
			tr.attr("style", "");
			btn.attr("value", "折叠");
			btn.attr("onclick", "expand(" + id + ", true)");
		}
	}

	function expandSplit(b) {
		var split = $("#splitPane");
		var treePane = $("#treePane");
		var contextPane = $("#context");
		
		if(b) {
			split.attr("onclick", "expandSplit(false)");
			split.attr("float", "left");
			treePane.css("display", "inline");
			contextPane.css("width", "794px");
		} else {
			split.attr("onclick", "expandSplit(true)");
			treePane.css("display", "none");
			contextPane.css("width", "948px");
		}
	}
	
	function showPane(type, status) {
		$('#context').empty();
		switch (type) {
		case 1:
			$('#context').html("<h1 align='center'>数据加载中</h1>");
			
			$.ajax({
		    	url: "./GetTrade",
		    	type: "GET",
		    	data: { status: status, status_oppr: 'eq' },
		    	dataType: "html"
		    	}).success(function(data) {
		    		$('#context').html(data);
		    	}).fail(function() {
		    		$('#context').html("<h1>加载出错</h1>");
		    	});
			
			//$.get('./GetTrade?status=' + status + '&status_oppr=eq', function(data) {
			  //$('#context').html(data);
			//});
			break;
		case 2:
			$('#context').html("<h1 align='center'>数据加载中</h1>");
			
			$.ajax({
		    	url: "./express/findAllExpress.action",
		    	type: "GET",
		    	dataType: "html"
		    	}).success(function(data) {
		    		$('#context').html(data);
		    	}).fail(function() {
		    		$('#context').html("<h1>加载出错</h1>");
		    	});
			
			//$.get('./express/findAllExpress.action', function(data) {
			  //$('#context').html(data);
			//});
			break;
		case 3:
			$('#context').html("<h1 align='center'>数据加载中</h1>");
			
			$.ajax({
		    	url: "./express/initPrintExpress.action",
		    	type: "GET",
		    	dataType: "html"
		    	}).success(function(data) {
		    		$('#context').html(data);
		    	}).fail(function() {
		    		$('#context').html("<h1>加载出错</h1>");
		    	});
			
			//$.get('./express/initPrintExpress.action', function(data) {
			  //$('#context').html(data);
			//});
			break;
		case 4:
			$('#context').html("<h1 align='center'>数据加载中</h1>");
			
			$.ajax({
		    	url: "test.html",
		    	type: "GET",
		    	dataType: "html"
		    	}).success(function(data) {
		    		$('#context').html(data);
		    	}).fail(function() {
		    		$('#context').html("<h1>加载出错</h1>");
		    	});
			
			//$.get('test.html', function(data) {
			  //$('#context').html(data);
			//});
			break;
		case 5:
			$('#context').html("<h1 align='center'>数据加载中</h1>");
			
			$.ajax({
		    	url: "./taobao/shopper.action",
		    	type: "GET",
		    	dataType: "html"
		    	}).success(function(data) {
		    		$('#context').html(data);
		    	}).fail(function() {
		    		$('#context').html("<h1>加载出错</h1>");
		    	});
		default:
			break;
		}	
		
	}
	 $(document).ready(function () {
    });
</script>
<link rel="stylesheet" type="text/css" href="css/mrp.css" />
</head>

<body>
    <div id="container">
        <div class="header">
            header
            <div id="message">
            显示的消息
            </div>
        </div>
        
        <div id="treePane">        	
            
            <div id="menu-box">
            	<h3>
                	<button oritabindex="0" tabindex="0">-</button>
                	<span>订单管理</span>                    
                </h3>
                <ul>
                	<li><span onclick="showPane(1, 1);">待付款</span></li>
                    <li><span onclick="showPane(1, 2);">待发货</span></li>
                    <li><span onclick="showPane(1, 3);">已发货</span></li>
                </ul>          
            </div>       
            
            <div id="menu-box">
            	<h3>
                	<button oritabindex="0" tabindex="0">-</button>
                	<span>发货助手</span>                    
                </h3>
                <ul>
                	<li>订单发货</li>
                    <li><span onclick="showPane(3, null);">打印快递单</span></li>
                    <li><span onclick="showPane(2, null);">快递单管理</span></li>
                </ul>          
            </div>       
            
            <div id="menu-box">
            	<h3>
                	<button oritabindex="0" tabindex="0">-</button>
                	<span>工具</span>                    
                </h3>
                <ul>
                	<li><span onclick="showPane(4, null);">测试页面</span></li>
                	<li><span onclick="showPane(5, null);">店铺数据</span></li>
                </ul>          
            </div> 
                  
        </div>
        
        <div id="splitPane" onclick='expandSplit(false)'>
        	<span>-</span>
        </div>
        
        <div id="context">
        	
        </div>
    </div>
</body>
</html>
